package com.qfedu.dao;

import com.qfedu.entity.Goodsbill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface GoodsBillDao extends JpaRepository<Goodsbill,String> {

    Goodsbill save(Goodsbill goodsbill);

    Goodsbill findByGoodsBillCode(String goodsBillCode);


    @Query(value = "select * from goodsbill g join cargoreceiptdetail c on " +
            " g.goods_bill_code = c.goods_bill_detail_id where c.goods_revert_bill_id = ?1",nativeQuery = true)
    Goodsbill selectGoodsBillByGoodsRevertBillId(String goodsRevertBillId);
}
